﻿@using Twitter.Extensions;
@{
var tweetTextAttribute = new HtmlString(!String.IsNullOrEmpty((string)Model.TweetText) ? string.Format(" data-text=\"{0}\"", Model.TweetText) : "");
var urlAttribute = new HtmlString(!String.IsNullOrEmpty((string)Model.Url) ? string.Format(" data-url=\"{0}\"", Model.Url) : "");
var languageAttribute = new HtmlString(!((int)Model.Language == 0) ? string.Format(" data-lang=\"{0}\"", Twitter.Extensions.TranslatorExtensions.ToLanguageCode(Model.Language)) : "");
var usernameAttribute = new HtmlString(!String.IsNullOrEmpty(Model.Username) ? string.Format(" data-via=\"{0}\"", Model.Username) : "");
var relatedAttribute = new HtmlString(!String.IsNullOrEmpty((string)Model.RelatedUsername) ? string.Format(" data-related=\"{0}{1}\"", Model.RelatedUsername, !String.IsNullOrEmpty((string)Model.RelatedUserDescription) ? ":" + Model.RelatedUserDescription : "") : "");
    }
<a href="http://twitter.com/share" class="twitter-share-button"@tweetTextAttribute@urlAttribute@languageAttribute@usernameAttribute@relatedAttribute data-count="@Model.DataCount.ToString().ToLower()">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>